package com.competition.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.competition.dao.EquipmentLeasingOrderDao;
import com.competition.entity.EquipmentLeasingOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.HashMap;
import java.util.List;

@Mapper
public interface EquipmentLeasingOrderMapper extends BaseMapper<EquipmentLeasingOrder> {
    List<EquipmentLeasingOrder> queryEquipmentOrderList(HashMap<String,Object> hashMap);
    @Select("SELECT equipment_leasing.`equipment_name`,equipment_leasing.`equipment_price`,equipment_leasing.`equipment_imgurl`,equipment_leasing_order.`equipment_order_status` FROM equipment_leasing_order,equipment_leasing WHERE  \n" +
            "equipment_leasing_order.`equipment_id` = equipment_leasing.`equipment_id` and user_id = #{openid} and equipment_order_status = #{through} limit #{current},5")
    List<EquipmentLeasingOrderDao> getSelectAllByUserIdAndAuditStatusAndAuditStatus(@Param("openid") String openid, @Param("through") String through, @Param("current")int current);
}
